//package douyin;
//
//import com.baomidou.mybatisplus.extension.exceptions.ApiException;
//import com.douyin.open.api.DefaultApi;
//import com.douyin.open.api.VideoPublishApi;
//import com.douyin.open.models.*;
//
//import java.io.File;
//
//public class DouyinUtils {
//    public static void main(String[] args) {
//
//        String clientKey = "awrqb247k7067ho7"; // String | 应用唯一标识
//        String clientSecret = "7e821669a591d103040e0aaf2e42c8bb"; // String | 应用唯一标识对应的密钥
//        String code = "Vf2QkIfa0WwGbTRnunfoXu2guNPC1DmVBmm2"; // String | 授权码
//        String grantType = "authorization_code"; // String | 写死\"authorization_code\"即可
//
////        File video = new File("http://dbxz1-hw.ahtv.cn/ahtv-obs/20201113/d6e020a6-0774-3e73-6f22-81b9dc3f9968.mp4");
//        File video = new File("D:\\TestVideo\\t4.mp4");
//
//        VideoPublishApi apiInstance = new VideoPublishApi();
////        DefaultApi defaultApi = new DefaultApi();
////        ToutiaoOauth2Oauth2InlineResponse200 result = defaultApi.oauthAccessTokenGet(clientKey, clientSecret, code, grantType);
//        String openId = "9fd7b53a-4183-4acc-844a-f6b6b538accf";
////        System.out.println("openId = " + openId);
//        String accessToken = "act.f89cde03f1c25047afa51051da56dfb6tEZedRDlsKFHmCE9R0mci1L6XOJO";
////        System.out.println("accessToken = " + accessToken);
////        Integer partNumber = 1;
////        try {
////            VideoCreateAwemeCreateInlineResponse2002 result2 = apiInstance.videoPartInitPost(openId, accessToken);
////            String uploadId = result2.getData().getUploadId();
////            VideoCreateAwemeCreateInlineResponse2003 result3 = apiInstance.videoPartUploadPost(video, openId, accessToken, uploadId, partNumber);
////            System.out.println(result3);
////            VideoCreateAwemeCreateInlineResponse2004 result4 = apiInstance.videoPartCompletePost(openId, accessToken, uploadId);
////            System.out.println(result4);
////        } catch (ApiException e) {
////            System.err.println("Exception when calling VideoPublishApi#videoPartInitPost");
////            e.printStackTrace();
////        }
//        String videoId = "";
//        VideoCreateAwemeCreateBody1 body = new VideoCreateAwemeCreateBody1();
//        body.setVideoId(videoId);
//        VideoCreateAwemeCreateInlineResponse2001 result = apiInstance.videoCreatePost(openId, accessToken, body);
//        System.out.println("result = " + result);
//    }
//}
